home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
mscheap2
/
reloc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-07
|
744b
|
41 lines
#include <stdio.h>
#include <heap.h>
//
// Example of _relocate from heap.man
//
int main()
{
void far *p1 = _fmalloc( 1000 );
void far *p2 = _fmalloc( 2000 );
void far *p3 = _fmalloc( 3000 );
void far *p4 = _fmalloc( 4000 );
void far *new;
_ffree( p1 );
_ffree( p3 );
printf("Before relocation\n\n");
_fheapdump( stdout, 1 );
new = _frelocate( p2 ); if (new != NULL) p2 = new;
new = _frelocate( p4 ); if (new != NULL) p4 = new;
printf("After relocation\n\n");
_fheapdump( stdout, 1 );
return( 0 );
}